package cn;

import java.util.Scanner;

public class a {
    public static int mcut(int[] p,int n){
        int[] r=new int[n+1];
        r[0]=0;
        for(int j=1;j<=n;j++) {
            int q = 0;
            for (int i = 1; i <= j; i++) {
                q = Math.max(q, p[i] + r[j - i]);
            }
            r[j]=q;
        }
        return r[n];
    }

    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n= scanner.nextInt();
        int[] arr={0,1,5,8,9,10,17,17,20,24,30};
        int b=mcut(arr,n);
        System.out.println(b);
    }
}
